// Admin Layout
.admin-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

// Header
.admin-header {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #252b3a;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  
  label {
    font-size: 14px;
    color: #575d6c;
    margin: 0;
  }
  
  .language-select {
    padding: 6px 12px;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
    
    &:hover {
      border-color: #5e7ce0;
    }
    
    &:focus {
      outline: none;
      border-color: #5e7ce0;
    }
  }
}

// Content
.admin-content {
  flex: 1;
  background: #f2f5fc;
  padding: 24px;
}

.content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  background: #fff;
  border-radius: 4px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.page-header {
  margin-bottom: 24px;
  
  h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #252b3a;
  }
}

// Toolbar
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  gap: 12px;
}

.toolbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid #dfe1e6;
  border-radius: 4px;
  width: 260px;
  font-size: 14px;
  transition: border-color 0.2s;
  
  &:focus {
    outline: none;
    border-color: #5e7ce0;
  }
  
  &::placeholder {
    color: #8a8e99;
  }
}

// Table
.table-hint {
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #e8f4ff;
  border-left: 3px solid #5e7ce0;
  border-radius: 4px;
  
  .hint-text {
    font-size: 13px;
    color: #575d6c;
  }
}

.table-container {
  margin-bottom: 16px;
  overflow-x: auto;
  border: 1px solid #dfe1e6;
  border-radius: 4px;
}

.simple-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  
  thead {
    background: #f2f5fc;
    
    th {
      padding: 12px 16px;
      text-align: left;
      font-weight: 600;
      font-size: 14px;
      color: #252b3a;
      border-bottom: 2px solid #dfe1e6;
      white-space: nowrap;
    }
  }
  
  tbody {
    tr {
      border-bottom: 1px solid #dfe1e6;
      transition: background 0.2s;
      
      &:hover {
        background: #f8f9fb;
      }
      
      &:last-child {
        border-bottom: none;
      }
    }
    
    td {
      padding: 12px 16px;
      font-size: 14px;
      color: #575d6c;
      vertical-align: middle;
    }
  }
  
  .price {
    color: #f66f6a;
    font-weight: 600;
  }
  
  .low-stock {
    color: #fac20a;
    font-weight: 600;
  }
  
  .description {
    display: block;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    
    &.status-active {
      background: #e9f4e9;
      color: #50d4ab;
    }
    
    &.status-inactive {
      background: #fef0f0;
      color: #f66f6a;
    }
  }
  
  .action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    
    button {
      padding: 6px 16px;
      border-radius: 4px;
      font-size: 13px;
      cursor: pointer;
      transition: all 0.2s;
      white-space: nowrap;
      border: 1px solid;
      font-weight: 500;
    }
    
    .btn-edit {
      background: #5e7ce0;
      color: #fff;
      border-color: #5e7ce0;
      
      &:hover {
        background: #4a6ac4;
        border-color: #4a6ac4;
      }
      
      &:active {
        background: #3d5aad;
        border-color: #3d5aad;
      }
    }
    
    .btn-delete {
      background: #fff;
      color: #f66f6a;
      border-color: #f66f6a;
      
      &:hover {
        background: #f66f6a;
        color: #fff;
      }
      
      &:active {
        background: #e55a50;
        border-color: #e55a50;
      }
    }
  }
}

.table-footer {
  padding: 12px 0;
  color: #575d6c;
  font-size: 14px;
}

// Form
.product-form {
  .form-group {
    margin-bottom: 20px;
  }
  
  .form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #252b3a;
    
    &.required::after {
      content: ' *';
      color: #f66f6a;
    }
  }
  
  .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dfe1e6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    
    &:focus {
      outline: none;
      border-color: #5e7ce0;
    }
  }
  
  textarea.form-control {
    resize: vertical;
    font-family: inherit;
  }
  
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

// Responsive Design
@media (max-width: 1200px) {
  .content-wrapper {
    padding: 20px;
  }
  
  .search-input {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .admin-header {
    padding: 0 16px;
    height: 56px;
  }
  
  .app-title {
    font-size: 18px;
  }
  
  .admin-content {
    padding: 16px;
  }
  
  .content-wrapper {
    padding: 16px;
  }
  
  .page-header h2 {
    font-size: 20px;
  }
  
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }
  
  .search-input {
    width: 100%;
  }
  
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .product-form .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .admin-header {
    padding: 0 12px;
  }
  
  .app-title {
    font-size: 16px;
  }
  
  .admin-content {
    padding: 12px;
  }
  
  .content-wrapper {
    padding: 12px;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 4px;
  }
}

// Custom Modal Styles
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-container {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #dfe1e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #252b3a;
  }
  
  .close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #8a8e99;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    
    &:hover {
      background: #f2f5fc;
      color: #252b3a;
    }
  }
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #dfe1e6;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .modal-container {
    width: 95%;
    max-height: 95vh;
  }
  
  .modal-header {
    padding: 16px 20px;
    
    h3 {
      font-size: 16px;
    }
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-footer {
    padding: 12px 20px;
  }
}
